<?php echo $this->fetch('header.html'); ?>
<ul class="nav nav-tabs">
	<li class="active"><a href="<?php echo $this->_var['appadmin']; ?>?m=comment"><?php echo $this->_var['lang']['comment_admin']; ?></a></li>
</ul>


<div class="rbox">
<table width="100%" border="0" class="table table-bordered">
  <tr>
    <td width="6%" height="24" align="center">ID</td>
    <td width="8%" align="center"><?php echo $this->_var['lang']['nickname']; ?></td>
    <td width="8%" align="center"><?php echo $this->_var['lang']['status']; ?></td>
    <td width="10%" align="center"><?php echo $this->_var['lang']['time']; ?></td>
     
    <td width="47%" align="center"><?php echo $this->_var['lang']['content']; ?></td>
    
    <td width="18%" align="center"><?php echo $this->_var['lang']['operation']; ?></td>
  </tr>
  <?php $_from = $this->_var['comment_list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
  <tr>
    <td align="center"><?php echo $this->_var['c']['id']; ?></td>
    <td align="center"><?php echo $this->_var['c']['nickname']; ?></td>
    <td align="center" class="status_text"><?php if ($this->_var['c']['status'] == 1): ?><?php echo $this->_var['lang']['unchecked']; ?><?php elseif ($this->_var['c']['status'] == 2): ?><?php echo $this->_var['lang']['checked']; ?><?php else: ?><?php echo $this->_var['lang']['forbidden']; ?><?php endif; ?></td>
    <td align="center"><?php echo date("Y-m-d",$this->_var['c']['dateline']); ?></td>
    
    <td align="left"><?php echo $this->_var['c']['content']; ?><a href="<?php echo $this->_var['c']['referer']; ?>" target="_blank">查看</a></td>
    <td align="center"> 
    <a href="javascript:;" class="changestatus" url="<?php echo $this->_var['appadmin']; ?>?m=comment&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=2" text='<?php echo $this->_var['lang']['checked']; ?>'><?php echo $this->_var['lang']['pass']; ?></a> 
    <a href="javascript:;" class="changestatus" url="<?php echo $this->_var['appadmin']; ?>?m=comment&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=99" text='<?php echo $this->_var['lang']['forbidden']; ?>'><?php echo $this->_var['lang']['forbid']; ?></a> 
    <a href="javascript:;" class="del" url="<?php echo $this->_var['appadmin']; ?>?m=comment&a=delete&id=<?php echo $this->_var['c']['id']; ?>"><?php echo $this->_var['lang']['delete']; ?></a></td>
  </tr>
  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
  
</table>
<?php echo $this->_var['pagelist']; ?>

</div>
<script language="javascript">
$(document).ready(function(){
	$(".changestatus").click(function(){
		obj=$(this);
		$.getJSON($(this).attr("url"),function(data){
			if(data.error=='0'){
				obj.parents("tr").children(".status_text").html(obj.attr("text"));
			}else{
				alert(data.message);
			}
		})
		
	});
	
});
</script>

<?php echo $this->fetch('footer.html'); ?>